import React from 'react';
import {
    useNavigate
} from "react-router-dom";

function My(props) {
    const navigate = useNavigate();
    return (
        <div>我的个人中心界面
            <p>欢迎{localStorage.getItem("userName")}的到来</p>
            <button onClick={()=>{
                localStorage.clear();
                navigate("/login")
            }}>退出登陆</button>
        </div>
    );
}

export default My;